Skip to content

Increase Jackson maxNameLength to support DynamoDB attribute names up…#6913

Merged
zoewangg merged 1 commit intomasterfrom
zoewang/jsonMaxNameLength
Apr 28, 2026
Merged

Increase Jackson maxNameLength to support DynamoDB attribute names up…#6913
zoewangg merged 1 commit intomasterfrom
zoewang/jsonMaxNameLength

Conversation

@zoewangg
Copy link
Copy Markdown
Contributor

Motivation and Context

DynamoDB allows attribute names up to 65,535 bytes(docs), but Jackson's default StreamReadConstraints.maxNameLength of 50,000 causes StreamConstraintsException when the SDK deserializes responses containing attribute names longer than 50K characters. Since Jackson is shaded inside the SDK, customers cannot override this setting.

Modifications

  • Override maxNameLength to 65,535 in AwsStructuredPlainJsonFactory.JSON_FACTORY to match the DynamoDB service limit. This is the JsonFactory used by all JSON-protocol service clients.

Testing

  • Added unit test in AwsStructuredPlainJsonFactoryTest verifying the JsonFactory can parse a 65,535-char
    field name.
  • Added WireMock integration test in LongAttributeNameTest (sync + async clients) that stubs a DynamoDB
    GetItem response with a 65,535-char attribute name and verifies end-to-end deserialization succeeds.
  • Ran one-off integration test against real DynamoDB with attribute names of 50,001 and 65,535 characters.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING
    document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the
    scripts/new-change script and following the instructions. Commit the new file created by the script in
    .changes/next-release with your changes.

License

  • I confirm that this pull request can be released under the Apache 2 license

@zoewangg zoewangg requested a review from a team as a code owner April 27, 2026 21:35
@zoewangg zoewangg added this pull request to the merge queue Apr 28, 2026
Merged via the queue into master with commit 0441df6 Apr 28, 2026
11 of 12 checks passed
@github-actions
Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants